<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>3D导航</title>
    <style>
        ul {
            margin: 0;
            padding: 0;
            list-style: none;
        }

        .navs {
            width: 300px;
            height: 40px;
            margin: 50px auto;
        }

        .navs li {
            width: 100px;
            height: 40px;
            line-height: 40px;
            float: left;
            position: relative;
            /* 开启3d tfs */
            transform-style: preserve-3d;
            /* 让利旋转看到 */
            /* transform: rotate3d(1,1,0,45deg); */
            /* 过渡效果 */
            transition: all 1s;

        }

        .navs li a {
            width: 100px;
            height: 40px;
            display: block;
            text-align: center;
            text-decoration: none;
            /* color: #fff; */
        }

        .navs li a:first-child {
            position: absolute;
            background-color: green;
            top: 0;
            left: 0;
            z-index: 99;
            transform: translateY(20px) translateZ(20px);

        }

        .navs li a:last-child {
            position: absolute;
            top: 0;
            left: 0;
            background-color: orange;
            /* 先躺平(参考系为自身的) 往z位移*/
            transform: rotateX(90deg);

        }

        /* 鼠标经过li  x轴转出来 */
        .navs li:hover {
            transform: rotateX(-90deg);
        }
    </style>
</head>

<body>
    <div class="navs">
        <ul>
            <li>
                <a href="#">首页</a>
                <a href="#">Index</a>
            </li>
            <li>
                <a href="#">登录</a>
                <a href="#">Login</a>
            </li>
            <li>
                <a href="#">注册</a>
                <a href="#">Register</a>
            </li>
        </ul>
    </div>
</body>

</html>